<%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>여기에 제목 입력</title>
<!-- 모바일 웹 페이지 설정 -->
<link rel="shortcut icon" href="assets/ico/favicon.png" />
<link rel="apple-touch-icon-precomposed"
 href="assets/ico/apple-touch-icon-57-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72"
 href="assets/ico/apple-touch-icon-72-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114"
 href="assets/ico/apple-touch-icon-114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144"
 href="assets/ico/apple-touch-icon-144-precomposed.png" />
<link rel="stylesheet" type="text/css"
 href="assets/font-awesome-4.0.3/css/font-awesome.min.css" />
<!-- bootstrap -->
<link rel="stylesheet" type="text/css"
 href="assets/css/bootstrap.min.css" />
<!-- 나눔고딕 웹 폰트 적용 -->
<link rel="stylesheet" type="text/css" href="assets/css/nanumfont.css" />
<!-- 반응형 웹을 지원하지 않을 경우 -->
<!-- <link rel="stylesheet" href="assets/css/non-responsive.css" /> -->
<!-- IE8 이하 버전 지원 -->
<!--[if lt IE 9]>
  <script type="text/javascript" src="assets/js/html5shiv.js"></script>
  <script type="text/javascript" src="assets/js/respond.min.js"></script>
  <![endif]-->
<!-- IE10 반응형 웹 버그 보완 -->
<!--[if gt IE 9]>
  <link rel="stylesheet" type="text/css" href="assets/css/ie10.css" />
  <script type="text/javascript" src="assets/js/ie10.js"></script>
  <![endif]-->

<title>metro_timesheet</title>
<link rel="stylesheet" href="assets/css/metro_timesheet.css">
</head>
<body>
 <!-- 상단 해더 바 -->
 <nav class="navbar navbar-fixed-top" role="navigation">
  <div class="nav_content text-center">
   <div class="nav_menu_btn pull-left text-center">
    <a class="back_btn" onclick="history.back();"><i
     class="fa fa-arrow-left"></i></a>
   </div>
   <span class="page_title"><strong>경로선택</strong></span>
  </div>
 </nav>
 <!-- 상단 해더 끝 -->
 
 <div class="metro_each_box">
  <div class="content">
 
   <div id="metro0" class="met-case">
    <div class="metro-list metro0">
     <span class="inner-case">
      <div class="inline-b left-side0"> </div>
      <div class="inline-b center0 abso"> </div>
      <div class="inline-b right-side0"> </div>
     </span>
    </div>
   </div>
 
   <div id="metro1" class="met-case">
    <div class="metro-list metro1">
     <span class="inner-case">
      <div class="inline-b left-side1"> </div>
      <div class="inline-b center1 abso"> </div>
      <div class="inline-b right-side1"> </div>
     </span>
    </div>
   </div>
 
   <div id="metro2" class="met-case">
    <div class="metro-list metro2">
     <span class="inner-case">
      <div class="inline-b left-side2"> </div>
      <div class="inline-b center2 abso"> </div>
      <div class="inline-b right-side2"> </div>
     </span>
    </div>
   </div>
 
   <div id="metro3" class="met-case">
    <div class="metro-list metro3">
     <span class="inner-case">
      <div class="inline-b left-side3"> </div>
      <div class="inline-b center3 abso"> </div>
      <div class="inline-b right-side3"> </div>
     </span>
    </div>
   </div>
  </div>
 
 </div>
 <table class="table table-striped"></table>
 

 <!-- Javascript -->
 <script src="assets/js/jquery.js"></script>
 <script src="assets/js/bootstrap.min.js"></script>
 <script type="text/javascript">
  $(function() {
   $('strong').html(sessionStorage["stn_nm"] + "역 시간표");
   var time = new Date();
   var day = 1;
   if (time.getDay() == 0) {
    day = 3;
   } else if (time.getDay() == 6) {
    day = 2;
   }
   var stn_cd = new Array();
   stn_cd = sessionStorage["stn_cd"].split(",");
   for (var i = 0; i < stn_cd.length / 2; i++) {
    for (var io_tag = 1; io_tag <= 2; io_tag++) {
     wheremetro(stn_cd[i * 2], day, io_tag, i);
    }
   }
   $(document).on(
     'click',
     '.metro-list-left',
     function() {
      timesheet(stn_cd[$(this).attr('leng') * 2], day,
        $(this).attr('io'));
      return false;
     });
   $(document).on(
     'click',
     '.metro-list-right',
     function() {
      timesheet(stn_cd[$(this).attr('leng') * 2], day,
        $(this).attr('io'));
      return false;
     });
  });
  
  
  
  function wheremetro(stn_cd, week_tag, io_tag, leng) {
   var timesh = '';
   var io1 = '';
   var io2 = '';
   var sno = '';
   var stn_url = "http://openapi.seoul.go.kr:8088/6372696d77617832303631/json/SearchArrivalInfoByIDService/1/5/"
     + stn_cd + "/" + io_tag + "/" + week_tag + "/";
   
   $.ajax({
      url : stn_url,
      dataType : "jsonp",
      timeout : 30000,
      cache : false,
      success : function(req) {
       var line_num = new Array();
       line_num = sessionStorage["stn_cd"].split(",");
       var arrive = req.SearchArrivalInfoByIDService.row[0].LEFTTIME;
       var time = new Date();
      if ((Number(arrive.substring(0, 2)) - time.getHours()) * 60 + (Number(arrive.substring(3, 5)) - time.getMinutes()) == 0) {
								if (io_tag == 1) {
									io1 += 	'<div class="metro-list-left btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io1 += 		'<strong class="text-danger">현재 역 도착</strong>';
									io1 += 		'<br />';
									io1 += 		'<i class="fa fa-caret-left" id="fa_left' + leng + '"></i>';
									io1 += 		'<br />';
									io1 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong>';
									io1 += 	'</div>';
									
									$(".left-side" + leng).html(io1);
								} else if (io_tag == 2) {
									sno += 	'<div>';
									sno += 		'<span class="metro-list-center" id="metro_line' + leng + '">';
									sno += 			'<strong>' + line_num[leng * 2 + 1] + '</strong>';
									sno += 		'</span>';
									sno += 	'</div>';
									
									io2 += 	'<div class="metro-list-right btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io2 += 		'<strong class="text-danger">현재 역 도착</strong>';
									io2 += 		'<br />';
									io2 += 		'<i class="fa fa-caret-right" id="fa_right' + leng + '"></i>';
									io2 += 		'<br />';
									io2 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong';
									io2 += '</div>';
									
									$(".center" + leng).html(sno);
									$(".right-side" + leng).html(io2);
								}
							} else if ((Number(arrive.substring(0, 2)) - time.getHours()) * 60 + (Number(arrive.substring(3, 5)) - time.getMinutes()) < 60) {
								if (io_tag == 1) {
									io1 += 	'<div class="metro-list-left btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io1 +=		'<strong class="text-danger">';
									io1 += 		(Number(arrive.substring(0, 2)) - time.getHours()) * 60 + (Number(arrive.substring(3, 5)) - time.getMinutes());
									io1 +=		'분 후</strong> 도착';
									io1 += 		'<br />';
									io1 += 		'<i class="fa fa-caret-left" id="fa_left' + leng + '"></i>';
									io1 += 		'<br />';
									io1 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong>';
									io1 += 	'</div>';
									
									$(".left-side" + leng).html(io1);
								} else if (io_tag == 2) {
									sno += 	'<div>';
									sno += 		'<span class="metro-list-center" id="metro_line' + leng + '">';
									sno += '<strong>' + line_num[leng * 2 + 1] + '</strong></span>';
									sno += 		'</span>';
									sno += 	'</div>';
									io2 += 	'<div class="metro-list-right btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io2 +=		'<strong class="text-danger">';
									io2 += 		(Number(arrive.substring(0, 2)) - time.getHours()) * 60 + (Number(arrive.substring(3, 5)) - time.getMinutes());
									io2 +=		'분 후</strong> 도착';
									io2 += 		'<br />';
									io2 += 		'<i class="fa fa-caret-right" id="fa_right' + leng + '"></i>';
									io2 += 		'<br />';
									io2 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong>';
									io2 += 	'</div>';
									$(".center" + leng).html(sno);
									$(".right-side" + leng).html(io2);
								}
								
							} else {
								if (io_tag == 1) {
									io1 += 	'<div class="metro-list-left btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io1 += 		'정보없음';
									io1 += 		'<br />';
									io1 += 		'<i class="fa fa-caret-left" id="fa_left' + leng + '"></i>';
									io1 += 		'<br />';
									io1 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong>';
									io1 += 	'</div>';
									$(".left-side" + leng).html(io1);
								} else if (io_tag == 2) {
									sno += 	'<div>';
									sno += 		'<span class="metro-list-center" id="metro_line' + leng + '">';
									sno += 				'<strong>' + line_num[leng * 2 + 1] + '</strong>';
									sno += 		'</span>';
									sno += 	'</div>';
									
									io2 += 	'<div class="metro-list-right btn inner-bax" io="' + io_tag + '" leng="' + leng + '">';
									io2 += 		'정보없음';
									io2 += 		'<br />';
									io2 += 		'<i class="fa fa-caret-right" id="fa_right' + leng + '"></i>';
									io2 += 		'<br />';
									io2 += 		'<strong>' + req.SearchArrivalInfoByIDService.row[0].SUBWAYNAME + '행</strong>';
									io2 += 	'</div>';
									$(".center" + leng).html(sno);
									$(".right-side" + leng).html(io2);
								}
  
       		}
      
      		for (var i=0; i<4; i++){
      			if ($('#metro_line' + i + ' > strong').html() == '1호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#1E1C87').css('color', '#1E1C87');
					$('#fa_left'+ i +'').css('color', '#1E1C87');	
					$('#fa_right'+ i +'').css('color', '#1E1C87');
				} else if ($('#metro_line' + i + ' > strong').html() == '2호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#17B42F').css('color', '#17B42F');
					$('#fa_left'+ i +'').css('color', '#17B42F');	
					$('#fa_right'+ i +'').css('color', '#17B42F');
				} else if ($('#metro_line' + i + ' > strong').html() == '3호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#FC4E07').css('color', '#FC4E07');
					$('#fa_left'+ i +'').css('color', '#FC4E07');	
					$('#fa_right'+ i +'').css('color', '#FC4E07');
				} else if ($('#metro_line' + i + ' > strong').html() == '4호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#1085DC').css('color', '#1085DC');
					$('#fa_left'+ i +'').css('color', '#1085DC');	
					$('#fa_right'+ i +'').css('color', '#1085DC');
				} else if ($('#metro_line' + i + ' > strong').html() == '5호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#8500E1').css('color', '#8500E1');
					$('#fa_left'+ i +'').css('color', '#8500E1');	
					$('#fa_right'+ i +'').css('color', '#8500E1');
				} else if ($('#metro_line' + i + ' > strong').html() == '6호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#9C3803').css('color', '#9C3803');
					$('#fa_left'+ i +'').css('color', '#9C3803');	
					$('#fa_right'+ i +'').css('color', '#9C3803');
				} else if ($('#metro_line' + i + ' > strong').html() == '7호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#546602').css('color', '#546602');
					$('#fa_left'+ i +'').css('color', '#546602');	
					$('#fa_right'+ i +'').css('color', '#546602');
				} else if ($('#metro_line' + i + ' > strong').html() == '8호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#F80055').css('color', '#F80055');
					$('#fa_left'+ i +'').css('color', '#F80055');	
					$('#fa_right'+ i +'').css('color', '#F80055');
				} else if ($('#metro_line' + i + ' > strong').html() == '9호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#CE9908').css('color', '#CE9908');
					$('#fa_left'+ i +'').css('color', '#CE9908');	
					$('#fa_right'+ i +'').css('color', '#CE9908');
				} else if ($('#metro_line' + i + ' > strong').html() == '인천1호선' ) {
					$('#metro_line'+ i +'').css('border-color', '#567CCA').css('color', '#567CCA');
					$('#fa_left'+ i +'').css('color', '#567CCA');	
					$('#fa_right'+ i +'').css('color', '#567CCA');
				} else if ($('#metro_line' + i + ' > strong').html() == '수인선' ) {
					$('#metro_line'+ i +'').css('border-color', '#F19C09').css('color', '#F19C09');
					$('#fa_left'+ i +'').css('color', '#F19C09');	
					$('#fa_right'+ i +'').css('color', '#F19C09');
				} else if ($('#metro_line' + i + ' > strong').html() == '공항철도' ) {
					$('#metro_line'+ i +'').css('border-color', '#4CA6E4').css('color', '#4CA6E4');
					$('#fa_left'+ i +'').css('color', '#4CA6E4');	
					$('#fa_right'+ i +'').css('color', '#4CA6E4');
				}else if ($('#metro_line' + i + ' > strong').html() == '경의선' ) {
					$('#metro_line'+ i +'').css('border-color', '#1DD591').css('color', '#1DD591');
					$('#fa_left'+ i +'').css('color', '#1DD591');	
					$('#fa_right'+ i +'').css('color', '#1DD591');
				} else if ($('#metro_line' + i + ' > strong').html() == '의정부경전철' ) {
					$('#metro_line'+ i +'').css('border-color', '#FD8808').css('color', '#FD8808');
					$('#fa_left'+ i +'').css('color', '#FD8808');	
					$('#fa_right'+ i +'').css('color', '#FD8808');
				} else if ($('#metro_line' + i + ' > strong').html() == '경춘선' ) {
					$('#metro_line'+ i +'').css('border-color', '#16AA69').css('color', '#16AA69');
					$('#fa_left'+ i +'').css('color', '#16AA69');	
					$('#fa_right'+ i +'').css('color', '#16AA69');
				} else if ($('#metro_line' + i + ' > strong').html() == '중앙선' ) {
					$('#metro_line'+ i +'').css('border-color', '#17B394').css('color', '#17B394');
					$('#fa_left'+ i +'').css('color', '#17B394');	
					$('#fa_right'+ i +'').css('color', '#17B394');
				} else if ($('#metro_line' + i + ' > strong').html() == '분당선' ) {
					$('#metro_line'+ i +'').css('border-color', '#F19909').css('color', '#F19909');
					$('#fa_left'+ i +'').css('color', '#F19909');	
					$('#fa_right'+ i +'').css('color', '#F19909');
				} else if ($('#metro_line' + i + ' > strong').html() == '신분당' ) {
					$('#metro_line'+ i +'').css('border-color', '#9D001C').css('color', '#9D001C');
					$('#fa_left'+ i +'').css('color', '#9D001C');	
					$('#fa_right'+ i +'').css('color', '#9D001C');
				} else if ($('#metro_line' + i + ' > strong').html() == '에버라인' ) {
					$('#metro_line'+ i +'').css('border-color', '#49C359').css('color', '#49C359');
					$('#fa_left'+ i +'').css('color', '#49C359');	
					$('#fa_right'+ i +'').css('color', '#49C359');
				}
      		}
      	}
      ,
      error : function(xhr, status, error) {
       // 6호선 회전 한 방향만 나오는 것
       var line_num = new Array();
       line_num = sessionStorage["stn_cd"].split(",");
       var hi = '';
       
       if (((line_num[leng * 2]) == 2611) || ((line_num[leng * 2]) == 2612) || ((line_num[leng * 2]) == 2613) || ((line_num[leng * 2]) == 2614) || ((line_num[leng * 2]) == 2615) ||((line_num[leng * 2]) == 2616)) {
        if (io_tag == 1) {
         hi += '<div class="left-box">';
         hi += '정보없음';
         hi += '<br />';
         hi += '<i class="fa fa-caret-left"></i>';
         hi += '<br />';
         hi += '</div>';
         $(".left-side" + leng).html(hi);
        }
       }
      }
     });
  }
  function timesheet(stn_cd, week_tag, io_tag) {
   var th = '';
   th += '<thead><tr>';
   th += '<th id="ltd">시</th>';
   th += '<th>분</th>';
   th += '</tr></thead><tbody>';
   var t5 = '<tr><td id="ltd"><strong>5</strong></td><td>';
   var t6 = '<tr><td id="ltd"><strong>6</strong></td><td>';
   var t7 = '<tr><td id="ltd"><strong>7</strong></td><td>';
   var t8 = '<tr><td id="ltd"><strong>8</strong></td><td>';
   var t9 = '<tr><td id="ltd"><strong>9</strong></td><td>';
   var t10 = '<tr><td id="ltd"><strong>10</strong></td><td>';
   var t11 = '<tr><td id="ltd"><strong>11</strong></td><td>';
   var t12 = '<tr><td id="ltd"><strong>12</strong></td><td>';
   var t13 = '<tr><td id="ltd"><strong>13</strong></td><td>';
   var t14 = '<tr><td id="ltd"><strong>14</strong></td><td>';
   var t15 = '<tr><td id="ltd"><strong>15</strong></td><td>';
   var t16 = '<tr><td id="ltd"><strong>16</strong></td><td>';
   var t17 = '<tr><td id="ltd"><strong>17</strong></td><td>';
   var t18 = '<tr><td id="ltd"><strong>18</strong></td><td>';
   var t19 = '<tr><td id="ltd"><strong>19</strong></td><td>';
   var t20 = '<tr><td id="ltd"><strong>20</strong></td><td>';
   var t21 = '<tr><td id="ltd"><strong>21</strong></td><td>';
   var t22 = '<tr><td id="ltd"><strong>22</strong></td><td>';
   var t23 = '<tr><td id="ltd"><strong>23</strong></td><td>';
   var t24 = '<tr><td id="ltd"><strong>24</strong></td><td>';
   var stn_url = "http://openapi.seoul.go.kr:8088/6372696d77617832303631/json/SearchSTNTimeTableByIDService/1/500/" + stn_cd + "/" + week_tag + "/" + io_tag + "/";
   $.ajax({
      url : stn_url,
      dataType : "jsonp",
      timeout : 30000,
      cache : false,
      success : function(req) {
       var check = 0;
       for (var i = 0; i < req.SearchSTNTimeTableByIDService.row.length; i++) {
        if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2)) == 0
          || Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2)) > 24) {
         continue;
        }
        if (i > 0
          && Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
            .substring(0, 2)) < Number(req.SearchSTNTimeTableByIDService.row[i - 1].LEFTTIME
            .substring(0, 2))) {
         continue;
        }
        if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2)) == 24) {
         check = 1;
        }
        if (check == 1
          && Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
            .substring(0, 2)) < 24) {
         continue;
        }
        
        if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2)) == 5) {
         t5 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t5 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 6) {
         t6 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t6 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 7) {
         t7 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t7 += ' ';
        } else if (req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2) == '08') {
         t8 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t8 += ' ';
        } else if (req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(0, 2) == '09') {
         t9 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t9 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 10) {
         t10 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t10 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 11) {
         t11 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t11 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 12) {
         t12 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t12 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 13) {
         t13 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t13 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 14) {
         t14 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t14 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 15) {
         t15 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t15 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 16) {
         t16 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t16 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 17) {
         t17 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t17 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 18) {
         t18 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t18 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 19) {
         t19 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t19 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 20) {
         t20 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t20 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 21) {
         t21 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t21 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 22) {
         t22 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t22 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 23) {
         t23 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t23 += ' ';
        } else if (Number(req.SearchSTNTimeTableByIDService.row[i].LEFTTIME
          .substring(0, 2)) == 24) {
         t24 += req.SearchSTNTimeTableByIDService.row[i].LEFTTIME.substring(3, 5);
         t24 += ' ';
        }
       }
       t5 += '</td></tr>';
       t6 += '</td></tr>';
       t7 += '</td></tr>';
       t8 += '</td></tr>';
       t9 += '</td></tr>';
       t10 += '</td></tr>';
       t11 += '</td></tr>';
       t12 += '</td></tr>';
       t13 += '</td></tr>';
       t14 += '</td></tr>';
       t15 += '</td></tr>';
       t16 += '</td></tr>';
       t17 += '</td></tr>';
       t18 += '</td></tr>';
       t19 += '</td></tr>';
       t20 += '</td></tr>';
       t21 += '</td></tr>';
       t22 += '</td></tr>';
       t23 += '</td></tr>';
       t24 += '</td></tr>';
       
       th += t5 + t6 + t7 + t8 + t9 + t10 + t11 + t12
         + t13 + t14 + t15 + t16 + t17 + t18 + t19
         + t20 + t21 + t22 + t23 + t24;
       th += '</tbody>';
       $('.table').html(th);
      },
      error : function(xhr, status, error) {
      }
     });
  }
 </script>
</body>
</html> 